home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / dev / src / wangisrc.lha / wangi / z / DefDTIcon / AppMenu.PAS < prev    next >
Pascal/Delphi Source File  |  1995-07-11  |  658b  |  36 lines

  1. Function InitAppIcons(VAR V : tProgVars;VAR AppPort : pMsgPort;
  2.                             VAR AppMenu : pAppMenuItem):Boolean;
  3.  
  4. VAR
  5.     res : Boolean;
  6.     
  7. Begin
  8.     res := False;
  9.     AppPort := CreateMsgPort;
  10.     If AppPort <> NIL then begin
  11.         AppMenu := AddAppMenuItemA(0,0,CStrConstPtrAR(@RKey, V.TEXT),AppPort,NIL);
  12.         If AppMenu <> NIL then
  13.             res := true;
  14.     end;
  15.     InitAppIcons := res;
  16. end;
  17.  
  18.  
  19. Procedure CleanAppMenu(VAR AppPort : pMsgPort;
  20.                                 VAR AppMenu : pAppMenuItem);
  21.  
  22. VAR
  23.     mes : pMessage;
  24.     OK : Boolean;
  25.  
  26. Begin
  27.     OK := RemoveAppMenuItem(AppMenu);
  28.     mes := GetMsg(AppPort);
  29.     While mes <> NIL do begin
  30.         ReplyMsg(mes);
  31.         mes := GetMsg(AppPort);
  32.     end;
  33.     DeleteMsgPort(AppPort);
  34. end;
  35.     
  36.